<extend name="Public/common"/>
<block name="othercss">
 <script type="text/javascript">
            var fwshop_root = '__ROOT__';
            var url_get_address = "{:U('get_address')}";
            var url_del_address = "{:U('Member/address_del')}";
            var url_add_address = "{:U('Member/address_add',array('type'=>'ajax'))}";
            var url_edit_address = "{:U('Member/address_edit',array('type'=>'ajax'))}";
			
			var url_province_sel = "{:U('Address/province_list')}?";
			var url_city_sel = "{:U('Address/city_sel')}?";//根据省份获取城市列表
            var url_area_sel = "{:U('Address/area_sel')}?";//根据城市获取地区列
			var url_get_zip = "{:U('Address/get_zip')}?";//根据地区获取邮政编码
			var url_address_add = "{:U('Member/address_add')}?";//添加收货地址请求地址
			
        </script>
               <link rel="stylesheet" type="text/css" href="__PUBLIC__/common/artDialog6/css/ui-dialog.css" />
        <script type="text/javascript" src="__PUBLIC__/common/artDialog6/dist/dialog-plus-min.js"></script>
        <script src="{$theme_path}/js/check.js?=v20190408_3"></script>
        <script src="{$theme_path}/js/member_address.js?=v20190109_2"></script>
</block>
<block name="header">
<div class="header">
    <div class="clearfix box">
       
        <a class="return" href="{:urlrotue('Member/index')}"><i class="return-icon"></i></a>
        <h2>选择收货地址</h2>
    </div>
</div>
</block>
<block name="body">

<!--end header-->
<div class="container pt50">
    <ul class="ssdz">
     <foreach name="list" item="item">
        <li class="clearfix">
            <div class="lans">
                <div class="clearfix">
                    <div class="right">{$item.phone}</div>
                    <div class="left">收货人：{$item.realname}</div>
                </div>
                <div class="t1">收货地址：{$item.province} {$item.city} {$item.area} {$item.address} {$item.zip}</div>
            </div>
            <div class="clearfix">
                <a class="list_on  <eq name="item['is_default']" value="1">on</eq>">
                    <img src="{$theme_path}/images/yuan-off.png" width="20"/>
                    <img src="{$theme_path}/images/yuan-on.png" width="20"/>默认地址
                </a>
                <a class="right1" href="{:urlrotue('Member/address_edit',Array('id'=>$item['id']))}">
                    <img src="{$theme_path}/images/edit-btn.png" width="20"/>编辑
                </a>
                <a class="right1" onclick="del_address({$item.id},this)">
                    <img src="{$theme_path}/images/d-btn.png" width="20"/>删除
                </a>
            </div>
        </li>
       </foreach>


    </ul>
              <div class="pagetion">
                          {$page}
             </div>
</div>

<div class="footer-loc">
    <a class="new-loc"  id="new_loc">新增收货地址</a>
</div>

<div class="bg-black" ></div>

<div class="loc_windown" id="lw1">
    <div class="container" style="padding:10px 0">
        <a class="closes clearfix" >
            &nbsp;&nbsp;选择地址<img src="{$theme_path}/images/close_icon.png" width="40">
        </a>
        <div class="wjmm" id="new_loc_content">
            <dl>
                <dd class="clearfix">
                    <input type="text"   id="realname" name="realname"  class="text2" placeholder="收件人"/>
                </dd>
               
            </dl>
            <dl>
                <dd class="clearfix" >
                 <span id="span_province">
                 <select name="province" id="province" >
                                        <option value="">选择省份</option>
                                        <foreach name="province" item="prov">
                                            <option value="{$prov.province}">{$prov.province}</option>
                                        </foreach>
                     </select>
                    </span>
                 <span id="span_city"></span>
                 <span id="span_area"></span>
                             
                </dd>
               
 
              
                <dd class="clearfix">
                    <input type="text" class="text2"  name="address" id="address" placeholder="详细地址"/>
                </dd>
                 <dd class="clearfix">
                    <input type="text"  name="phone" id="phone" class="text2" placeholder="手机号 - 中国+86"/>
                </dd>
                <dd class="clearfix">
                    <input type="text" class="text2" name="zip" id="zip" placeholder="邮政编码"/>
                </dd>
                <dd style="font-size:14px;">  <label><input type="checkbox" name="is_default" id="is_default" value="1" onclick="sel_all(this.form)" checked="checked" ><span></span></label>设置为默认地址 <span style="color:#F00; display:inline-block; margin-left:20px;" id="err_msg"></span></dd>
            </dl>
            <div class="wjmm-sub">
            </div>
            <a class="new-loc" id="btn_add">确认新增此地址</a>
        </div>
    </div>

    </div>
<!--弹出新增地址窗-->
<div class="loc-select">
    <i class="close "><img src="{$theme_path}/images/close_icon1.png" width="25"/> </i>
    <div class="title1" id="had_selected">请选择</div>

    <div class="title">选择省市/地区</div>
    <div class="place-cell2" id="province_city_area">
    
    </div>
</div>

</block>
<block name="footer"></block>
<block name="otherjs">
     <script src="{$theme_path}/js/member_address_ajax.js?20190408_6"></script>
<script type="text/javascript">
       $('#loc').click(function () {
            $('.bg-black').fadeIn();
            $('#lw').fadeIn();
            $('#f-loc').fadeOut();
        })
        // 关闭
		

        $('.closes').click(function () {
            $(this).parents('.loc_windown').fadeOut();
            $('.bg-black').fadeOut();
            $('#f-loc').fadeIn();
        })
		
        $('#loc-select').click(function () {
			
			$("#province_city_area").load(url_province_sel);//获得省份列表
            $('.loc-select').fadeIn();
            $('.bg-black').fadeIn();
        })
        $('.close').click(function () {
            $('.loc-select').fadeOut();
        })
        // 弹出新增地址
        $('#new_loc,.add_now').click(function () {
            $('.bg-black').fadeIn();
            $('#lw1').fadeIn();
            $('#lw').fadeOut();
        })
</script>
</block>



